/*
 * @Descripttion: 统一错误处理
 * @version: 
 * @Author: 一氧化二氢
 * @Date: 2022-01-01 23:54:41
 * @lastEditorTime: Do no edit
 */
module.exports = (err,ctx) =>{
    // console.log(err)
    let status = 500
    switch(err.code){
        case '10001':
            status =400
            break
        case '10002':
            status = 409
            break
        default:
            status = 500
    }
    ctx.status =status
    ctx.body = err
    console.log(err)
}